<?php

 $ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDTour";
 include_once("CBloqueoTable1.php");
 include_once("$ruta/MDTourGeneral/CDrawPageReg.php");
 include_once("$ruta/conf/CConfig.php");
 
if (!isset($_POST['multi'])) {$_POST['multi'] = "NULL"; }
if (!isset($_POST['from'])) {$_POST['from'] = "NULL"; }
if (!isset($_POST['to'])) {$_POST['to'] = "NULL"; }



$multiple = $_POST['multi'];
$from =  CDrawPageReg::getInstance()->amysql($_POST['from']);
$to = CDrawPageReg::getInstance()->amysql($_POST['to']);

$operadores="";
$i=0;

$campos = array("asf"=>"asfas","asfasf"=>"asfa");

foreach ($multiple as $r =>$c){
    $sql[]= "SELECT `pack`.`idPack` , `pack`.`OFICINAS_idOfi` , `pack_has_tour`.`idPackTour` , `pack_has_tour`.`pack_idPack` , `pack_has_tour`.`DateBegTour` , `pack_has_tour`.`DateEndTour` , `pack_has_tour`.`DefaultTourPack` , `pack_has_tour`.`Status` , `pack_has_tour`.`PriTour` , `operador`.`idOpe` , `oficinas`.`idOfi`
FROM pack LEFT JOIN `viv`.`oficinas` ON `pack`.`OFICINAS_idOfi` = `oficinas`.`idOfi` 
LEFT JOIN `viv`.`pack_has_tour` ON `pack`.`idPack` = `pack_has_tour`.`pack_idPack` 
LEFT JOIN `viv`.`operador` ON `oficinas`.`OPERADOR_idOpe` = `operador`.`idOpe` 
WHERE ((DateBegTour BETWEEN '$from' AND '$to' AND idOpe =$c))";
    CBloqueoTable1::getInstance()->DrawTable("Operador $c",$sql[$i],$campos);
    $i = $i+1;
}

?>